<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<style type="text/css">
	#userList{
		width: 1024px;
		height: 600px;
		margin: 0 auto 0auto;
	}
	#userListTable{
		width: 800px;
		margin: 100px auto 0 auto;
		border: 1px solid;
		border-collapse: collapse;
	}
	#userListTable td,#userListTable th{
		border:1px solid;
	}
</style>
</head>
<body>
	<c:if test="${not empty message }">
			<script type="text/javascript">
				alert('${message}');
			</script>
	</c:if>
	<table id="userListTable">
		<tr>
			<td>
				<a href="changeLocale?localeType=en_US"><spring:message code="page.index.english"/></a>
			</td>
		
		
			<td>
				<a href="changeLocale?localeType=zh_CN"><spring:message code="page.index.chinese"/></a>
			</td>
		</tr>
		<tr>
			<td colspan="4"><a href="add"><spring:message code="page.index.add"/></a></td>	
		</tr>
		<tr>
			<th><spring:message code="user.id.message"/></th>
			<th><spring:message code="user.name.message"/></th>
			<th><spring:message code="user.age.message"/></th>
			<th><spring:message code="user.action.message"/></th>
		</tr>
		<c:forEach items="${userList}" var="user">
			<tr>
				<td>${user.id }</td>
				<td>${user.name }</td>
				<td>${user.age }</td>
				<td>
					<a href="edit/${user.id }">${edit }</a>&nbsp;
					<a href="delete/${user.id }"><spring:message code="page.index.delete"/></a>
				</td>
			</tr>
		</c:forEach>
	</table>
	
</body>
</html>